// 引入request封装的axios
import request from '@/utils/request'

/**
 *@description 获取员工列表
 * @param {page,size} params
 */
export const getEmployeesListApi = (params) => request({
  url: '/sys/user',
  params
})

/**
 * @description 删除员工基本信息
 * @param {*} id
 */
export const delEmployeesListApi = (id) => request({
  url: `/sys/user/${id}`,
  method: 'DELETE'
})

/**
 * 新增员工
 * @param {*} data
 */
export const addEmployeesListApi = (data) => request({
  url: '/sys/user',
  method: 'POST',
  data
})

/**
 *批量导入员工
 * @param {*} data
 */
export const importEmployeeApi = (data) => request({
  url: '/sys/user/batch',
  method: 'POST',
  data
})

/**
 * @description 保存员工基本信息
 * @param {*} data
 */
export const saveUserInfoApi = (data) => request({
  url: `/sys/user/${data.id}`,
  method: 'PUT',
  data
})

/**
 * @description 给员工分配角色
 * @param {*} data
 */
export const setAssignRolesApi = (data) => request({
  url: '/sys/user/assignRoles',
  method: 'PUT',
  data
})
